package com.example.day16.ex03;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class MapDemo03 {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("张无忌", "赵敏");
        map.put("郭靖", "黄蓉");
        map.put("杨过", "小龙女");

//        V get (Object key):根据键获取值
//        System.out.println(map.get("张无忌"));
//        System.out.println(map.get("张三丰"));
//        Set<K> keySet ():获取所有键的集合
//        Set<String> keySet = map.keySet();
//        for (String key : keySet) {
//            System.out.println(key);
//        }
//        Collection<V> values ():获取所有值的集合
        Collection<String> values = map.values();
        for (String value : values) {
            System.out.println(value);
        }


    }
}
